<script lang="ts">
import { defineComponent, reactive } from 'vue'
import { start } from 'qiankun'
import { useRouter, useRoute } from 'vue-router'
export default defineComponent({
  setup() {
    return reactive({
      path: useRoute().path,
      microApp: '' as any
    })
  },
  created() {},
  deactivated() {
    window.qiankunStarted = false
  },
  async mounted() {
    if (!window.qiankunStarted) {
      window.qiankunStarted = true
      start()
    } else {
      const router = useRouter()
      const route = useRoute()
    }
  },
  activated() {},
  updated() {},

  methods: {
    // restartQianKun() {
    //   window.qiankunStarted = true
    //   console.log('我刚进来了乾坤1111')
    //   start()
    // },
    // startQianKun() {
    //   if (!window.qiankunStarted) {
    //     console.log('我刚进来了乾坤')
    //     this.restartQianKun()
    //   }
    // }
  }
})
</script>
<template>
  <div id="app-micro"></div>
</template>
